import { http } from '@/utils/http'
import type { LoginResult } from '@/types/member'
// type LoginParams={
//     code:string,
//     encryptedData:string,
//     iv:string,
// }
type LoginParams = {
  phoneNumber: string
}
// 小程序登录
// @param data请求参数
export const postLoginWxminAPI = (data: LoginParams) => {
  return http<LoginResult>({
    method: 'POST',
    url: '/login/wxMin',
    data,
  })
}
// export const postLoginWxminAPI2=(data:LoginParams)=>{
//     return http<any>({
//         method:'POST',
//         url:'/login/wxMin/simple',
//         data,
//     })
// }
/**
 * 小程序登录_内测版
 * @param phoneNumber 模拟手机号码
 */
export const postLoginWxMinSimpleAPI = (phoneNumber: string) => {
  return http<LoginResult>({
    method: 'POST',
    url: '/login/wxMin/simple',
    data: {
      phoneNumber,
    },
  })
}
